package com.xdf.xzymanagementsystem.enums;

public enum BillStateEnum {
    DELETED(-1,"deleted","已删除"),INVALID(0,"invalid","已作废"),
    EFFECTIVE(1,"effective","正常的，有效的"),
    AUDITED(2,"audited","已审核"),
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    BillStateEnum(int id,String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static BillStateEnum ofid(int id){
        for(BillStateEnum item:BillStateEnum.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static BillStateEnum ofsid(String sid){
        for(BillStateEnum item:BillStateEnum.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
